import request from "@/utils/request.ts";

/**
 * 获取所有的分类信息
 */
export function getCategoryAllUrl() {
    return request({
        url: '/blog/category/all',
        method: 'get'
    })
}

/**
 * 获取文章分类列表
 * @param params
 * @param params.pageNum
 * @param params.pageSize
 * @param params.categoryName
 * @returns
 */
export function getArticleCategoryListUrl(params: any) {
    return request({
        url: '/blog/category/list',
        method: 'get',
        params: params
    })
}

export function updateCategoryUrl(data: any) {
    return request({
        url: '/blog/category/update',
        method: 'put',
        data: data
    })
}
export function addCategoryUrl(data: any) {
    return request({
        url: '/blog/category/add',
        method: 'post',
        data: data
    })
}

export function deleteCategoryUrl(params: any) {
    return request({
        url: '/blog/category/remove',
        method: 'delete',
        params: params
    })
}
